package com.example.administrator.logdemo_and_activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class IndexActivity extends AppCompatActivity {
    private static final String ACTIVITY_TAG="INDEXDEMO";
    Button button1 = null;
    Button bt2 = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_index);

        Log.v(IndexActivity.ACTIVITY_TAG,"IndexActivity ---> OnCreate");

        button1 = (Button)findViewById(R.id.log);
        button1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(IndexActivity.this,LogActivity.class);
                startActivity(intent);
            }
        });

        bt2 = (Button)findViewById(R.id.bt2lifecycle);
        bt2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(IndexActivity.this,LifeCycleActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected void onDestroy() {
        Log.v(IndexActivity.ACTIVITY_TAG,"IndexActivity ---> onDestory.");
        super.onDestroy();
    }

    @Override
    protected void onPause() {
        Log.v(IndexActivity.ACTIVITY_TAG,"IndexActivity ---> onPause.");
        super.onPause();
    }

    @Override
    protected void onResume() {
        Log.v(IndexActivity.ACTIVITY_TAG,"IndexActivity ---> onResume.");
        super.onResume();
    }

    @Override
    protected void onRestart() {
        Log.v(IndexActivity.ACTIVITY_TAG,"IndexActivity ---> onRestart.");
        super.onRestart();
    }

    @Override
    protected void onStart() {
        Log.v(IndexActivity.ACTIVITY_TAG,"IndexActivity ---> onStart.");
        super.onStart();
    }

    @Override
    protected void onStop() {
        Log.v(IndexActivity.ACTIVITY_TAG,"IndexActivity ---> onStop.");
        super.onStop();
    }
}
